@import (reference) 'config';
@import (reference) 'icons';
@import (reference) "../../../app/less/typography";

body.dex .dex-wrapper,
body.dex-demo .dex-wrapper {
  w-dex-my-balance {

    .visible-row-container {
      min-height: 30px;
    }

    .smart-table {
      .to-dex-link {
        cursor: default;
      }
      &__row {
        padding: 6px 14px;
      }

      &__cell[data-column-id="asset"] {
        flex-basis: 25%;

        w-asset-logo,
        span {
          cursor: pointer;
        }
      }

      &__cell[data-column-id="assetId"] {
        flex-basis: 35%;
        min-width: 35%;
      }

      &__cell[data-column-id="total"],
      &__cell[data-column-id="available"],
      &__cell[data-column-id="inOrders"] {
        text-align: right;
        flex-basis: calc(50% / 3);
      }

      &__cell[data-column-id="controls"] {
        display: none;
      }

      &__cell[data-column-id="asset"] {
        display: flex;
        align-items: center;
      }

      w-copy-wrap {
        border: 0 none;
        border-radius: 0;
        height: 18px;
        background-color: transparent;
        width: 100%;

        .container {
          padding: 0;
          cursor: pointer;
          font-size: @font-size-caption-2;
          line-height: inherit;
          display: inline-block;
          width: auto;
          text-overflow: ellipsis;
          overflow: hidden;

          @media screen and (min-width: 1025px) and (max-width: 1550px) {
            max-width: 250px;
          }

          @media screen and (max-width: 400px) {
            max-width: 300px;
          }

          @media screen and (min-width: 660px) and (max-width: 820px) {
            max-width: 220px;
          }

          span {
            text-overflow: ellipsis;
            overflow: hidden;
            max-width: 300px;
            display: block;
            width: 100%;
          }
        }

        .copy-icon {
          border-left: 0 none;
          flex-basis: 24px;
          position: relative;
          height: 18px;
          margin-top: -4px;
          background: @dex-copybalance-icon no-repeat right center;
        }
      }

      .search-input {
        background-position: 4px center;
        padding-left: 24px;
      }
    }

    w-asset-logo {
      margin-right: 10px;
      cursor: pointer;
    }

  }
}

@media screen and (min-width: 1024px) {
  body.dex,
  body.dex-demo {
    .dex-wrapper {
      .tradehistory-fullscreen {
        w-dex-my-balance .smart-table w-copy-wrap .container {
          max-width: 300px;
          width: 300px;
        }
      }
    }
  }
}

@media screen and (max-width: 1024px) {

  body.dex .dex-wrapper,
  body.dex-demo .dex-wrapper {
    w-dex-my-balance {
      .smart-table {
        min-width: 100%;

        &__w-thead {
          .smart-table {
            &__row {
              height: 37px;
              border-top: 1px solid @color-basic-100;
              padding: 0 10px;

              &:hover {
                background: @color-white;
              }
            }

            &__search-container .search-input {
              height: 36px;
            }

            &__cell {
              display: none;
            }

            &__cell:first-child {
              display: block;
              height: 37px;
              flex-basis: 100%;
            }
          }
        }

        &__row {
          padding: 8px 38px 8px 12px;
          flex-wrap: wrap;
          margin: 0 2px;
          width: calc(100% ~'- 4px');

          &.active {
            background: @color-basic-50;

            .smart-table {
              &__cell[data-column-id="assetId"] {
                display: flex;
              }

              &__cell[data-column-id="inOrders"],
              &__cell[data-column-id="total"] {
                display: block;
              }
            }
          }

          &:hover {
            background: @color-basic-50;
          }
        }

        &__cell {
          .cell-label {
            display: inline-block;
          }
        }

        &__cell[data-column-id="asset"] {
          flex-basis: calc(50% ~ '- 20px');
        }

        &__cell[data-column-id="assetId"] {
          display: none;
          order: 4;
          margin-top: 4px;
          flex-basis: 100%;
          height: 18px;
        }

        &__cell[data-column-id="price"] {
          text-align: left;
          order: 2;
        }

        &__cell[data-column-id="amount"] {
          order: 3;
        }

        &__cell[data-column-id="inOrders"] {
          margin-top: 4px;
          flex-basis: calc(50% ~'- 20px');
          text-align: left;
          display: none;
        }

        &__cell[data-column-id="total"] {
          margin-top: 4px;
          flex-basis: calc(50% ~'- 20px');
          text-align: right;
          display: none;
        }

        &__cell[data-column-id="available"] {
          flex-basis: calc(50% ~'- 20px');

          w-balance {
            min-width: 74px;
          }
        }

        w-copy-wrap .copy-icon {
          margin-top: 0;
        }
      }
    }
  }
}
